
#include <gtest\gtest.h>
#include <vector>

#include "Display.h"
#include "GlobalVariavles.h"
#include "Movables.h"
#include "Game.h"
//
//using namespace std;
//
//
//
//
//
////At this point in project development, the constructor of the game class generates a default map 
////containing sand and holes and initializes a digdug data member to locatiion (45, 45) on the screen map.
////Digdugs speed is initialized to 1 units/move
////As this form of initialization will be altered in the final project, no unit tests are written for it
//
//
////
//TEST(Game, canMoveDigDugInSpecifiedDirection)
//{
//	Game testGame;
//
//	int start_y_position = testGame._digdug.y();
//	int start_x_position = testGame._digdug.x();
//	int speed = testGame._digdug.speed();
//
//	testGame.move(testGame._digdug, RIGHT);
//
//	EXPECT_TRUE(start_y_position  == testGame._digdug.y());
//	EXPECT_TRUE(start_x_position  + speed  == testGame._digdug.x());
//
//	testGame.move(testGame._digdug, UP);
//
//	EXPECT_TRUE(start_y_position - speed  == testGame._digdug.y());
//	EXPECT_TRUE(start_x_position + speed  == testGame._digdug.x());
//	EXPECT_TRUE(true);
//
//}
//
//
////Tests of get_rule function in Game class
//TEST(Game, getRuleReturnsCanMoveForDigdugDetectingSand)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(DIGDUG, SAND);
//
//		EXPECT_EQ(rule, CAN_MOVE);
//
//}
//
//TEST(Game, getRuleReturnsCanMoveForDigdugDetectingHole)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(DIGDUG, HOLE);
//
//		EXPECT_EQ(rule, CAN_MOVE);
//}
//
//TEST(Game, getRuleReturnsDeathToDigdugForDigdugDetectingMonster)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(DIGDUG, MONSTER);
//
//		EXPECT_EQ(rule, DEATH_TO_DIGDUG);
//}
//
//TEST(Game, getRuleReturnsCannotMoveForMonsterDetectingSand)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(MONSTER, SAND);
//
//		EXPECT_EQ(rule, CANT_MOVE);
//}
//
//TEST(Game, getRuleReturnsCanMoveForMonsterDetectingHole)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(MONSTER, HOLE);
//
//		EXPECT_EQ(rule, CAN_MOVE);
//}
//
//TEST(Game, getRuleReturnsDeathToMonsterForMonsterDetectingProjectile)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(MONSTER, PROJECTILE);
//
//		EXPECT_EQ(rule, DEATH_TO_MONSTER);
//}
//
//TEST(Game, getRuleReturnsDeathToDigdugForMonsterDetectingDigdug)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(MONSTER, DIGDUG);
//
//		EXPECT_EQ(rule, DEATH_TO_DIGDUG);
//}
//
//TEST(Game, getRuleReturnsCanOverlapForMonsterDetectingMonster)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(MONSTER, MONSTER);
//
//		EXPECT_EQ(rule, CAN_OVERLAP);
//}
//
//TEST(Game, getRuleReturnsDeathToMonsterForProjectileDetectingMonster)
//{
//		Game testGame;
//
//		Rules rule = testGame.get_rule(PROJECTILE, MONSTER);
//
//		EXPECT_EQ(rule, DEATH_TO_MONSTER);
//}
//
////Tests for the contains(Direction) function in Game class
//
//TEST(Game, containsFunctionReturnsFalseForEmptyDirectionVector)
//{
//	Game testGame;
//
//	vector<Direction> directions;
//	directions.clear();
//
//	EXPECT_FALSE(testGame.contains(directions, UP));
//	EXPECT_FALSE(testGame.contains(directions, DOWN));
//	EXPECT_FALSE(testGame.contains(directions, LEFT));
//	EXPECT_FALSE(testGame.contains(directions, RIGHT));
//}
//
//TEST(Game, containsFunctionReturnsFalseIfTestedDirectionIsNotContainedInCheckedDirectionVector)
//{
//	Game testGame;
//
//	vector<Direction> directions;
//	directions.push_back(LEFT);
//	directions.push_back(RIGHT);
//	directions.push_back(DOWN);
//	directions.push_back(LEFT);
//
//	EXPECT_FALSE(testGame.contains(directions, UP));
//
//}
//
//TEST(Game, containsFunctionReturnsTrueIfTestedDirectionIsFoundOnceInCheckedDirectionVector)
//{
//	Game testGame;
//
//	vector<Direction> directions;
//	directions.push_back(LEFT);
//	directions.push_back(RIGHT);
//	directions.push_back(DOWN);
//	directions.push_back(LEFT);
//
//	EXPECT_TRUE(testGame.contains(directions, RIGHT));
//
//}
//
//TEST(Game, containsFunctionReturnsTrueIfTestedDirectionIsFoundMoreThanOnceInCheckedDirectionVector)
//{
//	Game testGame;
//
//	vector<Direction> directions;
//	directions.push_back(LEFT);
//	directions.push_back(RIGHT);
//	directions.push_back(DOWN);
//	directions.push_back(LEFT);
//
//	EXPECT_TRUE(testGame.contains(directions, LEFT));
//
//}
////Tests for get_valid_directiosns function of Game class
//
//TEST(Game, digdugCanMoveIntoSandAndHoles)
//{
//	Game testGame;
//	//by default, digdug is placed in a tunnel with sand on his left anf right and holes above and below him
//	vector<Direction> possible_directions;
//
//	possible_directions = testGame.get_valid_directions(testGame._digdug.x(), testGame._digdug.y(), testGame._digdug);
//
//	EXPECT_TRUE(possible_directions.size() == 4);
//}
//
//TEST(Game, digdugCannotMoveIntoGameBoundaries)
//{
//	Game testGame;
//	//Place digdug in top left corner
//	testGame._digdug.set_location(0 + testGame._digdug.radius(), 0 + testGame._digdug.radius());
//	vector<Direction> possible_directions;
//
//	possible_directions = testGame.get_valid_directions(testGame._digdug.x(), testGame._digdug.y(), testGame._digdug);
//
//	EXPECT_FALSE(testGame.contains(possible_directions,UP));
//	EXPECT_FALSE(testGame.contains(possible_directions, LEFT));
//	
//}
